/*
 * ENUM Discoverer. ENUM Demonstration software, demonstrating the potential of ENUM.
 * 
 * Copyright (C) 2009 SIDN and ISOC.nl
 * 
 * This file is part of ENUM Discoverer.
 *
 * ENUM Discoverer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ENUM Discoverer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with ENUM Discoverer.  If not, see <http://www.gnu.org/licenses/>.
 */

package nl.sidn.enumdiscoverer.contacts.dao;

import java.io.Serializable;

/**
 * Encapsulates latitude and longitude
 * @author	Grant Patterson (grant.patterson@catalyst.net.nz)
 */
public class Coords implements Serializable {
	
	private static final long serialVersionUID = 7402524160731035672L;
	
	private final int mLatitude;
	private final int mLongitude;
	
	/**
	 * Create a Coords instance
	 * @param latitudeE6 The latitude * 1000000
	 * @param longitudeE6 The longitude * 1000000
	 */
	public Coords(int latitudeE6, int longitudeE6) {
		mLatitude = latitudeE6;
		mLongitude = longitudeE6;
	}
	
	/**
	 * Gets the latitude * 1000000
	 * @return
	 */
	public int getLatitudeE6() {
		return mLatitude;
	}
	
	/**
	 * Gets the longitude * 1000000
	 * @return
	 */
	public int getLongitudeE6() {
		return mLongitude;
	}
	
	@Override
	public String toString() {
		return "(" + mLatitude / 1E6 + ", " + mLongitude / 1E6 + ")";
	}
}
